<?php get_header() ?>
<div id="content">
<?php $count = 0 ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post() ?>
<?php if ( $count == 0 ) : ?>
<?php if ( is_category() ) : ?>
<div class="block">
<h1><?php echo single_cat_title() ?></h1>
<p>You are currently browsing the articles from <a href="<?php echo bloginfo('home') ?>/"><?php echo bloginfo('name') ?></a> matching the category <nobr><?php echo single_cat_title() ?></nobr>.</p>
</div>
<?php elseif ( is_day() ) : ?>
<div class="block">
<h1><?php the_time('F jS, Y') ?></h1>
<p>You are currently browsing the articles from <a href="<?php echo bloginfo('home') ?>/"><?php echo bloginfo('name') ?></a> written on <nobr><?php the_time('F jS, Y') ?></nobr>.</p>
</div>
<?php elseif ( is_month() ) : ?>
<div class="block">
<h1><?php the_time('F Y') ?></h1>
<p>You are currently browsing the articles from <a href="<?php echo bloginfo('home') ?>/"><?php echo bloginfo('name') ?></a> written in the month of <nobr><?php the_time('F Y') ?></nobr>.</p>
</div>
<?php elseif ( is_year() ) : ?>
<div class="block">
<h1><?php the_time('Y') ?></h1>
<p>You are currently browsing the articles from <a href="<?php echo bloginfo('home') ?>/"><?php echo bloginfo('name') ?></a> written in the year <nobr><?php the_time('Y') ?></nobr>.</p>
</div>
<?php endif // is_category() ?>
<?php endif // $count == 0 ?>
<!-- google_ad_section_start -->
<div class="post">
<?php edit_post_link('Edit','<p class="edit">','</p>') ?>
<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php if ( get_the_title() ){ the_title(); }else{ echo "Untitled"; } ?></a></h1>
<?php if ( posts_mode() == 'summary' ) : ?>
<?php if ( trim(get_the_excerpt()) != "" ){ the_excerpt(); }else{ echo '<p>...</p>'; } ?>
<?php else : // posts_mode() == 'summary' ?>
<?php if ( get_the_content("", false, "") ){ the_content(); }elseif ( get_the_guid() ){ echo "<p><a href=\"".get_the_guid()."\"><img src=\"".get_the_guid()."\" alt=\"Click to enlarge\" class=\"thumbnail\" /></a></p>"; }else{ echo "<p>...</p>"; } ?>
<?php endif // posts_mode() == 'summary' ?>
<p><cite>
Written by <?php the_author() ?> on <a href="<?php echo get_day_link(get_the_time('Y'),get_the_time('m'),get_the_time('d')) ?>" title="View all posts written on <?php the_time('F jS, Y') ?>"><?php the_time('F jS, Y') ?></a> with <?php comments_popup_link('no comments','1 comment','% comments','','comments disabled') ?>.<br />
Read more articles on <?php the_category(' and ') ?>.
</cite></p>
</div>
<!-- google_ad_section_end -->
<?php if ( $count == 0 ) : ?>
<?php include (TEMPLATEPATH.'/ad2.php') ?>
<?php endif // $count == 0 ?>
<?php if ( $count == 1 ) : ?>
<?php include (TEMPLATEPATH.'/ad3.php') ?>
<?php endif // ( $count == 1 ) ?>
<?php $count++ ?>
<?php endwhile // have_posts() ?>
<?php //include (TEMPLATEPATH.'/pagination.php') ?>
<?php else : // have_posts()?>
<div class="block">
<h1>Not found</h1>
<p>Sorry, but we are unable to find any article matching your request.</p>
</div>
<?php include (TEMPLATEPATH.'/ad2.php') ?>
<?php endif // have_posts() ?>
<?php include (TEMPLATEPATH.'/ad4.php') ?>
</div>
<?php get_sidebar() ?>
<?php get_footer() ?>
